/*
 * LSyntaxHighlighter.h
 *
 *  Created on: 30/dic/2010
 *      Author: computer
 */

#ifndef LSYNTAXHIGHLIGHTER_H_
#define LSYNTAXHIGHLIGHTER_H_
#include <QSyntaxHighlighter>
#include <QPalette>
#include <QRegExp>
#include <QVector>
#include <QTextCharFormat>
#include <QTextDocument>

class LSyntaxHighlighter : public QSyntaxHighlighter {
	Q_OBJECT
public:
	LSyntaxHighlighter(QTextDocument *parent = 0);
	virtual ~LSyntaxHighlighter();

	virtual void highlightBlock(const QString&);

private:
	struct HighlightingRule {
		QRegExp pattern;
		QTextCharFormat format;
	};
	QVector<HighlightingRule> highlightingRules;

	QRegExp commentStartExpression;
	QRegExp commentEndExpression;

	QTextCharFormat keywordFormat;
	QTextCharFormat classFormat;
	QTextCharFormat singleLineCommentFormat;
	QTextCharFormat multiLineCommentFormat;
	QTextCharFormat quotationFormat;
	QTextCharFormat functionFormat;
};

#endif /* LSYNTAXHIGHLIGHTER_H_ */
